package io.kiki.sba.registry.store.api.meta;

import io.kiki.sba.registry.common.model.console.PersistenceData;

import java.util.Map;


public interface ProvideDataRepository {

    /**
     * save or update provideData, such as stop_push_switch; directly use new value to override old
     * value;
     */
    boolean put(PersistenceData persistenceData);

    /**
     * save or update with cas, such as node_server_operate_list; it use previous value to produce new
     * value;
     */
    boolean put(PersistenceData persistenceData, long expectVersion);

    /**
     * query provideData by key
     */
    PersistenceData get(String key);

    /**
     * delete provideData
     */
    boolean remove(String key, long version);

    /**
     * query all provide data
     */
    Map<String, PersistenceData> getAll();
}
